package com.java.star.mall.common.utils;

import com.java.star.mall.common.exception.BusinessException;
import com.java.star.mall.common.response.StatusCode;

/**
 * 自定义断言类
 */
public class Asserts {

    public static void isTrue(boolean expression, StatusCode statusCode) {
        if (expression) {
            throw new BusinessException(statusCode);
        }
    }

    public static void isTrue(boolean expression, StatusCode statusCode, String message) {
        if (expression) {
            throw new BusinessException(statusCode, message);
        }
    }

}
